#ifndef __MAINFRAME_H__
#define __MAINFRAME_H__

#include <wx/wx.h>
#include "canvas.h"
#include "myTreeCtrl.h"
#include <wx/spinctrl.h>

class MainFrame : public wxFrame{
    public:
        MainFrame(const wxString&, const wxPoint&, const wxSize&, long style = wxDEFAULT_FRAME_STYLE);
        ~MainFrame();

    private:
        void OnExit(wxCommandEvent&);
        void OnMenuFileOpen(wxCommandEvent&);
        void OnMenuFileSave(wxCommandEvent&);
        void OnMenuFileExit(wxCommandEvent&);
        void OnMenuHelpAbout(wxCommandEvent&);

        void createMenu();
        void createBar();
        void createPanel();
        void createCanvas();

//        void addQuad(wxCommandEvent&);
//        void addCorner2d(wxCommandEvent&);
//        void addCircle(wxCommandEvent&);
        void addBox(wxCommandEvent&);
        void addCorner(wxCommandEvent&);
        void addSphere(wxCommandEvent&);
        void setOptions(wxCommandEvent&);

        void OnTreeKeyDown(wxTreeEvent&);
        void treeDeleteItens();
        void treeDoubleClick(wxTreeEvent&);

        void selectFromTree(wxCommandEvent&);
        void selectAdjacentVertices(wxCommandEvent&);
        void selectAdjacentEdges(wxCommandEvent&);
        void selectAdjacentFaces(wxCommandEvent&);
        void selectAdjacentSolids(wxCommandEvent&);

        void scaleDialog(wxCommandEvent&);
        void scale(wxCommandEvent&);
        void translateDialog(wxCommandEvent&);
        void translate(wxCommandEvent&);
        void analyseArea(wxCommandEvent&);
        void sweepDialog(wxCommandEvent&);
        void sweep(wxCommandEvent&);
        void bezier(wxCommandEvent&);
        void changeColor(wxCommandEvent&);

        void appendTreeItens(Solid *, wxString);

        GLCanvas* glCanvas;
        MyTreeCtrl *treeSolid;
        wxBoxSizer *sizer;
        wxBoxSizer *canvasSizer;
        wxBoxSizer *panelTreeSizer;
        wxSpinCtrl *lambdaSpinBox;
        wxSpinCtrl *xSpinBox;
        wxSpinCtrl *ySpinBox;
        wxSpinCtrl *zSpinBox;

    DECLARE_EVENT_TABLE()
};

enum{
    SELECT_MENU = 101,
    SELECT_ADJACENT_VERTICES_MENU,
    SELECT_ADJACENT_EDGES_MENU,
    SELECT_ADJACENT_FACES_MENU,
    SELECT_ADJACENT_SOLIDS_MENU,
    SELECT_FROM_TREE_MENU,
    SCALE_OPERATOR_MENU,
    TRANSLATE_OPERATOR_MENU,
    ANALYSE_AREA_MENU,
    SWEEP_MENU,
    BEZIER_MENU,
    COLOR_MENU,
//    ADD_QUAD,
//    ADD_CORNER2D,
//    ADD_CIRCLE,
    ADD_BOX,
    ADD_CORNER,
    ADD_SPHERE,
    SHOW_VERTICES,
    SHOW_EDGES,
    SHOW_FACES,
    SHOW_SOLIDS,
    SHOW_WIREFRAME,
    SHOW_CONTROL_POINTS,
    ID_SPINCTRL
};

#endif
